<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue过渡和动画</title>
    <script src="vue.js"></script>
   <style>
       @import "h.css";
   </style>
</head>
<body>
    <div id="app">
        <button @click="toggle">改变图形宽度</button>
        <transition name="box">
            <div class="chart" v-if="show"></div>
        </transition>
    </div>
        
     <script>
    var vm = new Vue({
        el:'#app',
        data:{
            show:true,
        },
        methods:{
            toggle(){
                this.show=!this .show //每次取反
            }
        }
    })
    </script>
</body>
</html>